﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SessionItemsSaved
{
    public partial class LabelSaver : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            if (Session["clicks"] == null)
            {
                Session["clicks"] = new List<string>() { this.TextBoxInput.Text };
            }
            else
            {
                (Session["clicks"] as List<string>).Add(this.TextBoxInput.Text);
            }
            foreach (var item in (Session["clicks"] as List<string>))
            {
                this.LabelResult.Text += Server.HtmlEncode(item);
                this.LabelResult.Text += "<br/>";
            }
        }
    }
}